<?php
session_start();
require_once("../models/Unit.php");
class UpdateAccountController{

	var $accountDetails;
	function sendAccountData(){
		$this->accountDetails['name'] = $_REQUEST['name'];
		$this->accountDetails['home'] = $_REQUEST['home'];
		$this->accountDetails['studnum'] = $_REQUEST['studnum'];
		$this->accountDetails['cellnum'] = $_REQUEST['cellnum'];
		$this->accountDetails['course'] = $_REQUEST['course'];
		$this->accountDetails['college'] = $_REQUEST['college'];
		$this->accountDetails['classification'] = $_REQUEST['classification'];
		$this->accountDetails['parents'] = $_REQUEST['parents'];
		$this->accountDetails['contact'] = $_REQUEST['contact'];
		$this->accountDetails['occupants'] = $_REQUEST['occupants'];
		$this->accountDetails['unitname'] = $_REQUEST['unitname'];

	}
	
	
}

	$a = new UpdateAccountController;
	$a->sendAccountData();
	$unit = new Unit;
	$unit->connect();
	$unit->changeAccountInfo($a->accountDetails);
	echo "You have successfully updated Unit ".$_REQUEST['unitname']."'s Account Information.";

	
?>